package com.ce.util.chart;

public abstract class AbstractChart {

	protected String title;
	protected Element root;
	
	public AbstractChart(String title) {
		super();
		this.title = title;
	}
	
	protected void addTitle2Root(){
		if(root==null)
			root = new Element("chart");
		Element label = root.addXPathChild("labels/label");
		label.addChild("y","20");
		label.addChild("align","center");
		label.addChild("text_size","18");
		label.addChild("text","").setCDATA("<b>"+title+"</b>");
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

}
